package com.hengpeng.msls.service.activity.impl;

import java.util.List;

import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;

import com.hengpeng.common.persist.query.DynamicQuery;
import com.hengpeng.common.persist.query.constants.QueryConstants.QueryType;
import com.hengpeng.itfinbase.en.RewardType;
import com.hengpeng.itfinbase.persist.Reward;
import com.hengpeng.msls.service.BaseService;
import com.hengpeng.msls.service.activity.RewardService;
@Lazy
@Service
public class RewardServiceImpl extends BaseService implements RewardService {

    @Override
    public List<Reward> findRewardByTypes(RewardType[] rewardTypes) {
        DynamicQuery query = new DynamicQuery(Reward.class);
        if (rewardTypes != null && rewardTypes.length > 0) {
            query.inArray("rewardType", rewardTypes);
        }
        query.setQueryType(QueryType.JDBC);
        return serviceFactory.getPersistService().find(Reward.class, query);
    }

}
